import request from '@/utils/request'

// 查询角色列表
export function getSysRoleList(data) {
  return request({
    url: '/sys_role/list',
    method: 'post',
    data,
  })
}

// 获取角色权限
export function getRolePermission(roleId) {
  return request({
    url: '/sys_role/permission',
    method: 'get',
    params: {
      roleId: roleId
    }
  })
}

//保存角色
export function saveRoles(data) {
  return request({
    url: '/sys_role/save',
    method: 'post',
    data: data
  })
}

// 查询角色详细
export function getRole(roleId) {
  return request({
    url: '/system/role/' + roleId,
    method: 'get'
  })
}





// 角色状态修改
export function changeRoleStatus(roleId, status) {
  const data = {
    roleId,
    status
  }
  return request({
    url: '/system/role/changeStatus',
    method: 'put',
    data: data
  })
}

